import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { PersistGate } from 'redux-persist/integration/react';
import { BrowserRouter,HashRouter } from 'react-router-dom'
import { persistor } from './store/index';
import store from './store/index'
import { Provider } from 'react-redux';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  // <React.StrictMode>//严格模式
  <BrowserRouter> 
  {/* Provider 负责将store传入到内层所有组件中 */}
  {/* <context.Provider store={store} value=''> */}
  <Provider store={store}>
      <PersistGate loading={null} persistor={persistor}>
      <App />
    </PersistGate>
  </Provider>
    
  {/* </context.Provider> */}
  </BrowserRouter>
// </React.StrictMode>
);

reportWebVitals();
